#include "value.h"
#include <thread>

extern atomic<int> x;
extern atomic<int> y;
extern atomic<int> z;
extern atomic<bool> go;

struct value value1[count];
struct value value2[count];
struct value value3[count];
struct value value4[count];
struct value value5[count];

int main(int argc, char** argv) {
	thread a(increment, &x, value1);
	thread b(increment, &y, value2);
	thread c(increment, &z, value3);
	thread d(readValues, value4);
	thread e(readValues, value5);
	go = true;
	a.join();
	b.join();
	c.join();
	d.join();
	e.join();
	printValues(value1);
	printValues(value2);
	printValues(value3);
	printValues(value4);
	printValues(value5);
	return 0;
}

